using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

namespace WebApplication1
{
    public partial class KYCDropDownList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        String name = String.Empty;
        String cssClass = String.Empty;
        String id = String.Empty;

        String seletedValue = String.Empty;
        List<ListItem> listItemArray = null;

        public String SeletedValue
        {
            get { return seletedValue; }
            set { seletedValue = value; }
        }

        public List<ListItem> ListItemArray
        {
            get { return listItemArray; }
            set { listItemArray = value; }
        }

        public String Name
        {
            get { return name; }
            set { name = value; }
        }

        public String ControlID
        {
            get { return id; }
            set { id = value; }
        }

        public String CssClass
        {
            get { return cssClass; }
            set { cssClass = value; }
        }

        public KYCDropDownList()
        {
            listItemArray = new List<ListItem>();
        }

        private void fillData ()
        {
            for (int i = 0; i < listItemArray.Count; i++)
            {
                ListItem listItem = listItemArray[i];
                dropDownListControl.Items.Add(listItem);
            }
            dropDownListControl.SelectedValue = seletedValue ;
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            dropDownListControl.ID = id;
            dropDownListControl.CssClass = cssClass;
            localizeControl.ID = "localize" + name;

            fillData();
            
        }

        protected override void OnPreRender(EventArgs e)
        {
            localizeControl.Text = name;
            base.OnPreRender(e);
        }
    }
}